package practice1;


import java.util.Arrays;

/**
 *
 * @author Tara
 * @implNote
 */
public class Pra3 {

    //实现插入排序
    public static void main(String[] args) {
        int[] arr = new int[]{1,4,3,7,5,9,0,6,7,8,3,1,4,56,87,33,22,95,23};
        System.out.println(arr[2]);
        for (int j = 0; j<arr.length-1;j++){
            for (int i = j; i>=0; i--){
                if (arr[i]>arr[i+1]){
                    swap(arr,i,i+1);
                }
            }
        }

        System.out.println(Arrays.toString(arr));
        System.out.println("23|1="+(32|1));
    }

    private static void swap(int[] arr,int a,int b){
        arr[a] ^= arr[b];
        arr[b] ^= arr[a];
        arr[a] ^= arr[b];
    }

    private static void swap2(int[] arr,int a,int b){
        int temp = arr[a];
        arr[a] = arr[b];
        arr[b] = arr[a];
    }




}
